/*
 * @Author: benchenchuang benchenchuang
 * @Date: 2023-05-12 17:51:10
 * @LastEditors: benchenchuang benchenchuang
 * @LastEditTime: 2023-08-12 11:18:19
 * @FilePath: /hmp-web/src/api/train/index.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import request from '@/utils/request';

/**
 * @description 查询列表
 */
export const remoteList = params => {
    return request.get('/sys/training/query', params);
};

/**
 * 添加
 */
export const addInfo = data => {
    return request.post('/sys/training/insert', data);
};
//新增人员信息
export const addPerson = data=>{
    return request.post(`/sys/training/insertPerson`,data)
}

//分页查询接口 人员
export const remotePersonQuery = params=>{
    return request.get(`/sys/training/queryPerson`,params)
}

/**
 * 更新
 */
export const updateInfo = data => {
    return request.post('/sys/training/update', data);
};

/**
 * 删除
 */
export const deleteInfo = data =>{
    return request.post(`/sys/training/delete`,data)
}

/**更新人员参与状态 */
export const updatePersonStatus = (trainId,personId) =>{
    return request.post(`/sys/training/updateTrainPersonStatus?trainId=${trainId}&personId=${personId}&personStatus=1`)
}
//更新培训状态
export const updateTrainStatus = (trainId,trainStatus)=>{
	return request.post(`/sys/training/updateTrainStatus?trainId=${trainId}&trainStatus=${trainStatus}`)
}
/**删除人员信息 */
export const deletePerson = (trainId,personId) =>{
    return request.post(`/sys/training/deletePerson?trainId=${trainId}&personId=${personId}`)
}

/**
 * 下载列表数据
 */
export const remoteDownload = data =>{
    return request.get(`/sys/training/downloadTraining`,data,'blob')
}

export default{
    remoteList
}